package com.wx.mall.order.controller;


import com.wx.mall.common.api.CommonResult;
import com.wx.mall.order.entity.OrderConfig;
import com.wx.mall.order.service.IOrderConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 订单配置 前端控制器
 * </p>
 *
 * @author j
 * @since 2020-04-24
 */
@RestController
@RequestMapping("/order-config")
@Api(tags = "订单配置",description = "OrderConfigController")
public class OrderConfigController {

    @Resource
    private IOrderConfigService service;


    @GetMapping("/selectById")
    @ApiOperation("根据id查询订单")
    public CommonResult<OrderConfig>  getById() {

       OrderConfig list=service.getById(1);
        return CommonResult.success(list);
    };

    @ApiOperation("修改配置")
    @PutMapping("/updateById")
    public CommonResult<Integer> updateById(OrderConfig list){


        boolean suceess=service.updateById(list);

        return suceess?CommonResult.success():CommonResult.failed();


    };

}

